package cn.mazexal.examapi.models.enums;

import lombok.Getter;

import java.io.Serializable;

/**
 * @author: Mazexal
 * Date: 2025/6/28
 */
@Getter
public enum PayWayEnum implements Serializable {
    /**
     * Apple支付
     */
    APPLE(101, "Apple支付"),

    /**
     * 华为支付
     */
    HUAWEI(111, "华为支付"),

    /**
     * 支付宝App支付
     */
    ALI_APP(201, "支付宝App支付"),

    /**
     * 支付宝H5支付
     */
    ALI_H5(202, "支付宝H5支付"),

    /**
     * 支付宝扫码支付
     */
    ALI_QR(203, "支付宝扫码支付"),

    /**
     * 支付宝网页支付
     */
    ALI_PC(204, "支付宝网页支付"),

    ALI_SMALL_APP(205, "支付宝小程序支付"),

    /**
     * 微信App支付
     */
    WX_APP(301, "微信App支付"),

    /**
     * 微信H5支付
     */
    WX_H5(302, "微信H5支付"),

    /**
     * 微信 WAP 支付
     */
    WX_WAP(303, "微信WAP支付"),

    YLSW_ALI(401, "银联商务支付宝支付"),
    YLSW_WX(402, "银联商务微信支付"),

//    HJ_ALI(404,"汇聚支付阿里h5"),

    NEWLY_ALI(405, "新生支付-阿里h5"),

    NEWLY_WX(406, "新生支付-微信h5"),

    NEWLY_YSF(407, "新生支付-云闪付"),

    NEWLY_WX_MINI(408, "新生支付-微信小程序"),
    ;

    private int value;
    private String name;

    PayWayEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public static PayWayEnum toEnum(int value) {
        for (PayWayEnum obj : PayWayEnum.values()) {
            if (obj.getValue() == value) {
                return obj;
            }
        }
        return null;
    }
}
